#include "gui.h"

sObject::sObject()
{
	id = sGUI::MainID.NextVal();
	sGUI::AllObjects.push_back(this);
}

sObject::~sObject()
{
	sGUI::AllObjects.remove(this);
}

void sObject::Process()
{

}


/*
	sEvent onclick;
	sEvent onmousemove;
	sEvent onmousedown;
	sEvent onmouseup;
	sEvent onmouseenter;
	sEvent onmouseleave;

	int x,y,width,height;
	float r,g,b,a;

	sPanelList childs;
*/

/*
class sButton : public sPanel
{
	char *caption;
	sPanel parent;
public:
*/

#include "gui_engine.cpp"
#include "panel.cpp"
#include "button.cpp"
#include "label.cpp"
#include "form.cpp"

int UpdateGUI()
{
	sGUI::cx = 0;
	sGUI::cy = 0;

	//active_gui_engine->FontStartDraw();

	std::for_each(sGUI::AllObjects.begin(),sGUI::AllObjects.end(),std::mem_fun(&sObject::Process));

	//active_gui_engine->FontEndDraw();

	//std::for_each(sGUI::AllObjects.begin(),sGUI::AllObjects.end(),std::mem_fun(&sObject::Draw));
	return 0;
};